package com.cheng.im.service.conversation.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cheng.im.common.bean.msg.ProtoMsgV1;
import com.cheng.im.service.common.model.SyncReq;
import com.cheng.im.service.common.model.SyncResp;
import com.cheng.im.service.common.resp.CommonResult;
import com.cheng.im.service.conversation.domain.ImConversationSet;
import com.cheng.im.service.conversation.model.req.AddConversationSetReq;
import com.cheng.im.service.conversation.model.req.DeleteConversationReq;
import com.cheng.im.service.conversation.model.req.PullConversationSet;
import com.cheng.im.service.conversation.model.req.UpdateConversationReq;
import com.cheng.im.service.conversation.model.resp.PullConversationSetResp;

import java.util.List;

public interface ImConversationSetService extends IService<ImConversationSet> {

    String convertConversationId(Integer type,String fromId,String toId);

    void  messageMarkRead(ProtoMsgV1.Message messageReadContend);

    /**
     * 删除会话
     * @param req
     * @return
     */
    CommonResult deleteConversation(DeleteConversationReq req);

    /**
     * 更新会话
     * @param req
     * @return
     */
    CommonResult updateConversation(UpdateConversationReq req);


    /**
     * 有状态客户端异步拉取会话
     * @param req
     * @return
     */
    CommonResult<SyncResp<ImConversationSet>> syncConversationSet(SyncReq req);

    /**
     * 新增会话
     */
    CommonResult addConversationSet(AddConversationSetReq addConversationSetReq);

    /**
     * 拉取最近100条会话
     */
    CommonResult<List<PullConversationSetResp>> pullConversationSet(PullConversationSet pullConversationSet);
}
